package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户钱包
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_user_wallet")
public class UserWallet extends Model<UserWallet> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "user_id", type = IdType.NONE)
    private String userId;
    /**
     * 卡号
     */
    @TableField("card_number")
    private String cardNumber;
    /**
     * 剩余金额
     */
    @TableField("remaining_amount")
    private BigDecimal remainingAmount;
    /**
     * 剩余赠送金额
     */
    @TableField("remaining_give_amount")
    private BigDecimal remainingGiveAmount;
    /**
     * 剩余充值金额
     */
    @TableField("remaining_recharge_amount")
    private BigDecimal remainingRechargeAmount;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    public void freeData() {
        this.userId = null;
        this.cardNumber = null;
        this.remainingAmount = null;
        this.remainingGiveAmount = null;
        this.remainingRechargeAmount = null;
        this.addTime = null;
        this.updateTime = null;
    }
}
